Prometheus by Brian Brazil
Author:Brian Brazil
Language: eng
Format: epub
Publisher: O'Reilly Media
Published: 2018-07-23T16:00:00+00:00
for _, g := range metrics.Gauges { name := invalidChars.ReplaceAllLiteralString(g.Name, "_") desc := prometheus.NewDesc(name, "Consul metric "+g.Name, nil, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.GaugeValue, float64(g.Value)) }
Processing of counters is similar, except that a _total suffix is added to the metric name:
for _, c := range metrics.Counters { name := invalidChars.ReplaceAllLiteralString(c.Name, "_") desc := prometheus.NewDesc(name+"_total", "Consul metric "+c.Name, nil, nil) ch <- prometheus.MustNewConstMetric( desc, prometheus.CounterValue, float64(s.Count)) }
The contents of metrics.Samples are more complicated. While the samples are a Prometheus summary, the Go client does not currently support those for MustNewConstMetric. Instead, you can emulate it using two counters. _seconds is appended to the metric name, and the sum is divided by a thousand to convert from milliseconds to seconds:
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12593)
Hello! Python by Anthony Briggs(9928)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9804)
The Mikado Method by Ola Ellnestam Daniel Brolund(9787)
Dependency Injection in .NET by Mark Seemann(9348)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8310)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7772)
Grails in Action by Glen Smith Peter Ledbrook(7705)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7567)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(7187)
Microservices with Go by Alexander Shuiskov(6951)
Practical Design Patterns for Java Developers by Miroslav Wengner(6868)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6813)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6425)
Angular Projects - Third Edition by Aristeidis Bampakos(6230)
The Art of Crafting User Stories by The Art of Crafting User Stories(5746)
NetSuite for Consultants - Second Edition by Peter Ries(5672)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5490)
Kotlin in Action by Dmitry Jemerov(5075)
